#include "GameManager.h"

int main()
{
	//-----------------example 1 : multi-thread ----------------------

	GameManager* g1 = new GameManager();
	GameManager* g2 = new GameManager();
	GameManager* g3 = new GameManager();

	thread t1 = g1->get_thread_task_loop(new MutableSolver(), new MutableSolver(), 3);
	thread t2 = g2->get_thread_task_loop(new MutableSolver(), new MutableSolver(), 4);
	thread t3 = g3->get_thread_task_loop(new MutableSolver(), new MutableSolver(), 5);

	t1.join();
	t2.join();
	t3.join();

	//---------------------END--------------------------------------------


	//----------------example 2 : multi-thread (suggest)---------------------------
	GameManager* g4 = new GameManager();
	GameManager* g5 = new GameManager();
	GameManager* g6 = new GameManager();


	//---------------get solver------------------
	MutableSolver* s1 = new MutableSolver();
	MutableSolver* s2 = new MutableSolver();
	MutableSolver* s3 = new MutableSolver();
	MutableSolver* s4 = new MutableSolver();
	MutableSolver* s5 = new MutableSolver();
	MutableSolver* s6 = new MutableSolver();


	//--------------config solver(set param)----------------
	s1->set_param(1, 1.1)->set_param(2, 2.3)->set_param(3, 3.3);
	s2->eval_setting(1.1, 2.2, 3.4);
	s3->eval_setting(1.1, 2.3, 3.3, 4.4);
	s3->change_move_time(10);

	thread t4 = g4->get_thread_task_loop(s1, s2, 3);
	thread t5 = g5->get_thread_task_loop(s3, s4, 4);
	thread t6 = g6->get_thread_task_loop(s5, s6, 5);

	//---------------start----------------------

	t4.join();
	t5.join();
	t6.join();

	//---------------------END--------------------------------------------



	//-------------example 3 : single thread---------------------
	GameManager* g7 = new GameManager();

	g7->task_loop(s1, s2, 5);
	//---------------------END--------------------------------------------


}